//
//  orderTableViewCell.m
//  CenturyInterconnection
//
//  Created by l-sheng on 6/14/16.
//  Copyright © 2016 Shanghai DuRui Information Technology Company. All rights reserved.
//

#import "orderTableViewCell.h"


@implementation orderTableViewCell


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}



- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if(self){
        
        
        UILabel * oLabel = [[UILabel alloc] init];
//        oLabel.frame = CGRectMake(10, 0, KScreenWidth/4, 28);
        oLabel.text = @"Order Number:";
        if (iPhone5) {
            oLabel.font = [UIFont systemFontOfSize:12];
        }else{
            oLabel.font = [UIFont systemFontOfSize:14];
        }
        [self.contentView addSubview:oLabel];
        [oLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.offset(10);
            make.top.offset(3);
            make.width.equalTo(self.mas_width).multipliedBy(0.4);
            make.height.equalTo(self.mas_height).multipliedBy(0.18);
        }];
        
        //订单号
        self.orderLabel = [[UILabel alloc] initWithFrame:CGRectZero];
        self.orderLabel.textAlignment = NSTextAlignmentLeft;
        if (iPhone5) {
            _orderLabel.font = [UIFont systemFontOfSize:11];
        }else{
            _orderLabel.font = [UIFont systemFontOfSize:13];
        }

        [self.contentView addSubview:self.orderLabel];
        [_orderLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(oLabel.mas_right).offset(5);
            make.right.offset(0);
            make.top.offset(3);
            make.height.equalTo(self.mas_height).multipliedBy(0.18);
        }];
        
        
        
        UILabel * tLabel = [[UILabel alloc] init];
        tLabel.text = @"Order Date:";
        if (iPhone5) {
            tLabel.font = [UIFont systemFontOfSize:12];
        }else{
            tLabel.font = [UIFont systemFontOfSize:14];
        }
        [self.contentView addSubview:tLabel];
        [tLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.offset(10);
            make.top.equalTo(oLabel.mas_bottom).offset(3);
            make.width.equalTo(self.mas_width).multipliedBy(0.4);
            make.height.equalTo(self.mas_height).multipliedBy(0.18);
        }];
        //订单日期
        self.timeLabel = [[UILabel alloc] initWithFrame:CGRectZero];
        self.timeLabel.textAlignment = NSTextAlignmentLeft;
        if (iPhone5) {
            _timeLabel.font = [UIFont systemFontOfSize:11];
        }else{
            _timeLabel.font = [UIFont systemFontOfSize:13];
        }
        [self.contentView addSubview:self.timeLabel];
        [_timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(tLabel.mas_right).offset(5);
            make.top.equalTo(oLabel.mas_bottom).offset(3);
            make.height.equalTo(self.mas_height).multipliedBy(0.18);
            make.right.offset(0);
        }];
        
        
//        //图片
//        self.imgView = [[UIImageView alloc] initWithImage:[UIImage createImageWithColor:[UIColor grayColor]]];
//        self.imgView.frame = CGRectMake(10, 30, 84, 84);
//        [self.contentView addSubview:self.imgView];
        
        
        
        UILabel * nLabel = [[UILabel alloc] init];
        nLabel.text = @"Consignee's Name:";
        if (iPhone5) {
            nLabel.font = [UIFont systemFontOfSize:12];
        }else
        {
            nLabel.font = [UIFont systemFontOfSize:14];
        }
        [self.contentView addSubview:nLabel];
        [nLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.offset(10);
            make.top.equalTo(tLabel.mas_bottom).offset(3);
            make.width.equalTo(self.mas_width).multipliedBy(0.4);
            make.height.equalTo(self.mas_height).multipliedBy(0.18);
        }];
        //名称
        self.NameLabel = [[UILabel alloc] initWithFrame:CGRectZero];
        if (iPhone5) {
            _NameLabel.font = [UIFont systemFontOfSize:11];
        }else{
            _NameLabel.font = [UIFont systemFontOfSize:13];
        }
        self.NameLabel.textAlignment = NSTextAlignmentLeft;
        self.NameLabel.numberOfLines = 0;
        [self.contentView addSubview:self.NameLabel];
        [_NameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(nLabel.mas_right).offset(5);
            make.right.offset(0);
            make.top.equalTo(tLabel.mas_bottom).offset(3);
            make.height.equalTo(self.mas_height).multipliedBy(0.18);
        }];
        
        
        UILabel * pLabel = [[UILabel alloc] init];
        pLabel.text = @"Total Price:";
        if (iPhone5) {
            pLabel.font = [UIFont systemFontOfSize:12];
        }else{
            pLabel.font = [UIFont systemFontOfSize:14];
        }
        [self.contentView addSubview:pLabel];
        [pLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.offset(10);
            make.top.equalTo(nLabel.mas_bottom).offset(3);
            make.width.equalTo(self.mas_width).multipliedBy(0.4);
            make.height.equalTo(self.mas_height).multipliedBy(0.18);
        }];

        //价格
        self.priceTotalLabel = [[UILabel alloc] initWithFrame:CGRectZero];
//        self.priceTotalLabel.frame = CGRectMake(0, 100, KScreenWidth-10, 28);
        self.priceTotalLabel.textAlignment = NSTextAlignmentLeft;
        if (iPhone5) {
            _priceTotalLabel.font = [UIFont systemFontOfSize:11];
        }else{
             _priceTotalLabel.font = [UIFont systemFontOfSize:13];
        }
        [self.contentView addSubview:self.priceTotalLabel];
        [_priceTotalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(pLabel.mas_right).offset(5);
            make.top.equalTo(nLabel.mas_bottom).offset(3);
            make.height.equalTo(self.mas_height).multipliedBy(0.18);
            make.right.offset(0);
        }];

        
     //支付状态
        UILabel * sLabel = [[UILabel alloc] init];
        sLabel.text = @"Order Status:";
        if (iPhone5) {
            sLabel.font = [UIFont systemFontOfSize:12];
        }else{
            sLabel.font = [UIFont systemFontOfSize:14];
        }
        [self.contentView addSubview:sLabel];
        [sLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.offset(10);
            make.top.equalTo(pLabel.mas_bottom).offset(3);
            make.width.equalTo(self.mas_width).multipliedBy(0.4);
            make.height.equalTo(self.mas_height).multipliedBy(0.18);
        }];
        
        
        self.statusLabel = [[UILabel alloc] initWithFrame:CGRectZero];
        self.statusLabel.textAlignment = NSTextAlignmentLeft;
        if (iPhone5) {
            _statusLabel.font = [UIFont systemFontOfSize:11];
        }else{
            _statusLabel.font = [UIFont systemFontOfSize:13];
        }
        [self.contentView addSubview:self.statusLabel];
        [_statusLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(sLabel.mas_right).offset(5);
            make.top.equalTo(pLabel.mas_bottom).offset(3);
            make.right.offset(0);
            make.height.equalTo(self.mas_height).multipliedBy(0.18);
        }];
    
    }
    return self;
    
}

@end
